package com.xnyzc.lhy.mis.controller.cmsapi.withdrawalrules;

import com.xnyzc.lhy.common.entity.Rv;
import com.xnyzc.lhy.mis.entity.param.cms.agreement.AgreementParam;
import com.xnyzc.lhy.mis.service.cms.withdrawalrules.CmsWithdrawalRulesService;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author zhaolijie
 * @date
 */
@RestController
@RequestMapping(value = "/cmsapi/withdrawalRules")
public class CmsWithdrawalRulesController {

    @Autowired
    private CmsWithdrawalRulesService cmsWithdrawalRulesService;


    /**
     * 获取提现规则列表
     *
     * @return
     */
    @GetMapping(value = "/getWithdrawalRulesList")
    public Rv getWithdrawalRulesList(
    ) {
        return cmsWithdrawalRulesService.getWithdrawalRulesList();
    }


    /**
     * 获取帮助中心列表
     *
     * @return
     */
    @GetMapping(value = "/getHelpCenter")
    public Rv getHelpCenter(
    ) {
        return cmsWithdrawalRulesService.getHelpCenter();
    }

    /**
     * 获取帮助详情信息
     *
     * @param parentId：父级编号
     * @return
     */
    @GetMapping(value = "/getHelpCenterDetail")
    public Rv getHelpCenterDetail(String parentId) {
        return cmsWithdrawalRulesService.getHelpCenterDetail(parentId);
    }

    /**
     * 修改帮助详情信息
     *
     * @param param：
     * @return
     */
    @PostMapping(value = "/updateHelpCenter")
    public Rv updateHelpCenter(@ApiParam(name = "param", value = "修改传参") @RequestBody AgreementParam param) {
        return cmsWithdrawalRulesService.updateHelpCenterDetail(param);
    }

    /**
     * 根据Id查询帮助信息
     *
     * @param id：
     * @return
     */
    @GetMapping(value = "/getHelpCenterById")
    public Rv getHelpCenterById(Integer id) {
        return cmsWithdrawalRulesService.getHelpCenterById(id);
    }
}
